package team.unstudio.unknownrpg_base.attribute;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import indi.defoliation.unknownrpg.api.attribute.Attribute;

public class LoreAttribute extends Attribute {
	
	private List<String> loreList = new ArrayList<>();
	
	public void addLore(String... str) {
		loreList.addAll(Arrays.asList(str));
	}
	
	@Override
	public Map<String, Object> serialize() {
		HashMap<String,Object> map = new HashMap<>();
		map.put("lore", loreList);
		return map;
	}

	@Override
	public String getKeyName() {
		return "Lore";
	}

	@Override
	public String getDisplayName() {
		return "描述";
	}

	@SuppressWarnings("unchecked")
	@Override
	public void deserialize(Map<String, Object> map) {
		this.loreList = (List<String>) map.get("lore");
	}
	
	public List<String> getLore() {
		return loreList;
	}
}

